function object(o){
    //为避免父类构造函数的调用，实例化其副本
    function F(){}
    F.prototype = o;
    return new F();
}

//继承原型(避免调用父类构造函数)
function inheritPrototype(subType, superType){
    var prototype = object(superType.prototype);
    prototype.constructor = subType;
    subType.prototype = prototype;
}

function SuperClass(name){
    this.name = name;
    this.colors = ["red"];
}

SuperClass.prototype.show = function(){
    alert(this.colors);
}

function SubClass(name, age){
    //继承属性
    SuperClass.call(this, name);
    this.age = age;
}
//继承原型
inheritPrototype(SubClass,SuperClass);

var s1 = new SubClass("小明", 18);
var s2 = new SubClass("张三", 20);

s1.colors.push("blue");
s1.show();
s2.show();

/*寄生+组合式继承实现避免了重复的调用父类构造函数并且避免了子类原型产生多余的属性，是目前最理想的继承实现方式*/